/**
 *
 */
package test;

import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;

import javax.management.Query;
import javax.management.QueryExp;

import org.apache.commons.beanutils.BeanUtils;
import org.apache.commons.lang3.ObjectUtils;

/**
 * @Title:
 * @author zhoujie
 * @date 2019年1月16日 上午11:35:55 
 *
 */
public class Snippet {

    public static void main(String[] args) {
        QueryExp exp = Query.and(Query.gt(Query.attr("age"), Query.value(5)),
                Query.match(Query.attr("name"),
                        Query.value("Smith")));
        //System.out.println(exp);
        String[] strs = {"java8", "is", "easy", "to", "use"};
        List<String> distinctStrs = Arrays.stream(strs)
                .map(str -> str.split(""))  // 映射成为Stream<String[]>
                .flatMap(Arrays::stream)  // 扁平化为Stream<String>
                .distinct()
                .collect(Collectors.toList());
        System.out.println(distinctStrs);
        //System.out.println(ObjectUtils.defaultIfNull(object, defaultValue));
    }
}

